/*
* Copyright (c)  2017, ueboot.com
* All rights reserved.
* 2017-11-07 19:40:18
*/
package com.ueboot.weishop.service.lottery.impl;

import com.ueboot.weishop.entity.lottery.LotteryRecordEntity;
import com.ueboot.core.repository.BaseRepository;
import com.ueboot.weishop.repository.lottery.LotteryRecordRepository;
import com.ueboot.core.service.impl.BaseServiceImpl;
import com.ueboot.weishop.service.lottery.LotteryRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by ziv  on 2017-11-07 19:40:18.
 *
 * @author ziv
 * @since 2.0 by autocode
 */
@Slf4j
@Service
public class LotteryRecordServiceImpl extends BaseServiceImpl<LotteryRecordEntity> implements LotteryRecordService {
	@Autowired
	private LotteryRecordRepository lotteryRecordRepository;

	@Override
	protected BaseRepository getBaseRepository() {
		return lotteryRecordRepository;
	}

	@Override
	public List<LotteryRecordEntity> findByExtStatus(Integer extStatus) {
		return lotteryRecordRepository.findByExtStatus(extStatus);
	}

	@Override
	@Transactional(rollbackFor = Exception.class, timeout = 120, propagation = Propagation.REQUIRED)
	public Integer updateExtStatusByExtStatus(Integer extStatusSet, Integer extStatusWhere) {
		return lotteryRecordRepository.updateExtStatusByExtStatus(extStatusSet, extStatusWhere);
	}
}
